<template>
  <div>
    <div class="py-1 px-1 bg-white">
      <div v-for="(item, index) in descList" :key="index">
        <div>
          <custom-details-item :icon="item.icon" :label="item.label">
            <template #valueSlot>
              <span v-if="!item.isFile">{{ item.value }}</span>
              <template v-else>
                <el-link type="primary" @click="openAttachPopUp(item.value)">查看</el-link>
              </template>
            </template>
          </custom-details-item>
        </div>
      </div>
    </div>
    <attachPopUp ref="attachPopUp" />
  </div>
</template>

<script>
import commonList from '@/assets/mixin/commonList'

export default {
  mixins: [commonList],
  data() {
    return {
      current: '',
      companyId: '',
      companyName: '',
      descList: [
        { label: '企业名称', value: '', fieldName: 'companyName', icon: '&#xe7e5;' },
        { label: '年份', value: '', fieldName: 'years', icon: '&#xe8d5;' },
        { label: '月份', value: '', fieldName: 'month', icon: '&#xe8d5;' },
        { label: '本月计提金额（万元）', value: '', fieldName: 'currentAmount', icon: '&#xe692;' },
        { label: '本月实际提取金额（万元）', value: '', fieldName: 'currentActualAmount', icon: '&#xe634;' },
        { label: '本月支出金额（万元）', value: '', fieldName: 'costCount', icon: '&#xe69a;' },
        { label: '实际支出占实际提取金额比例%', value: '', fieldName: 'amountActualCompleRate', icon: '&#xe677;' },
        { label: '实际支出占计提金额比例%', value: '', fieldName: 'amountCompleRate', icon: '&#xe685;' },
        { label: '附件', isFile: true, value: [], fieldName: 'shareAttachVos', icon: '&#xe685;', uuid: '' },
        { label: '上报时间', value: '', fieldName: 'reportTime', icon: '&#xe685;' }
      ],
      factoryImgList: []
    }
  },
  mounted() {
    const { current, companyId } = this.$route.query
    this.companyId = companyId || ''
    this.current = current || ''
    this.$nextTick(() => {
      this.descList.forEach(v => {
        v.value = this.$route.query[v.fieldName] ? this.$route.query[v.fieldName] : v.value || this.$route.query[v.fieldName]
        if (v.fieldName === 'projectAttachName') {
          v.uuid = this.$route.query.projectAttachUuid
        }
      })
    })
  }
}
</script>

<style lang="scss" scoped>
.olMap {
  width: 100%;
  height: 350px;
}
</style>
